﻿using MapMaker.Engine.CoreCommon;
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace MapMaker.Engine.Model.VXAce
{
    public class RPG_Event
    {
        [RubyProperty("id")]
        public int ID { get; set; }

        [RubyProperty("name")]
        public string Name { get; set; }

        [RubyProperty("x")]
        public int X { get; set; }

        [RubyProperty("y")]
        public int Y { get; set; }

        [RubyProperty("pages")]
        public List<RPG_Page> Pages { get; set; }

        public class RPG_Page
        {
            [RubyProperty("condition")]
            public RPG_Condition Condition { get; set; }

            [RubyProperty("graphic")]
            public RPG_Graphic Graphic { get; set; }

            [RubyProperty("move_type")]
            public int MoveType { get; set; }

            [RubyProperty("move_speed")]
            public int MoveSpeed { get; set; }

            [RubyProperty("move_frequency")]
            public int MoveFrequency { get; set; }

            [RubyProperty("move_route")]
            public RPG_MoveRoute MoveRoute { get; set; }

            [RubyProperty("walk_anime")]
            public bool WalkAnime { get; set; }

            [RubyProperty("step_anime")]
            public bool StepAnime { get; set; }

            [RubyProperty("direction_fix")]
            public bool DirectionFix { get; set; }

            [RubyProperty("through")]
            public bool Through { get; set; }

            [RubyProperty("priority_type")]
            public int PriorityType { get; set; }

            [RubyProperty("trigger")]
            public int Trigger { get; set; }

            [RubyProperty("list")]
            public List<RPG_EventCommand> List { get; set; }

            public class RPG_Condition
            {
                [RubyProperty("switch1_valid")]
                public bool Switch1Valid { get; set; }

                [RubyProperty("switch2_valid")]
                public bool Switch2Valid { get; set; }

                [RubyProperty("variable_valid")]
                public bool VariableValid { get; set; }

                [RubyProperty("self_switch_valid")]
                public bool SelfSwitchValid { get; set; }

                [RubyProperty("item_valid")]
                public bool ItemValid { get; set; }

                [RubyProperty("actor_valid")]
                public bool ActorValid { get; set; }

                [RubyProperty("switch1_id")]
                public int Switch1ID { get; set; }

                [RubyProperty("switch2_id")]
                public int Switch2ID { get; set; }

                [RubyProperty("variable_id")]
                public int VariableID { get; set; }

                [RubyProperty("variable_value")]
                public int VariableValue { get; set; }

                [RubyProperty("self_switch_ch")]
                public object SelfSwitchCh { get; set; }

                [RubyProperty("item_id")]
                public int ItemID { get; set; }

                [RubyProperty("actor_id")]
                public int ActorID { get; set; }
            }
            public class RPG_Graphic
            {
                [RubyProperty("tile_id")]
                public int TileID { get; set; }

                [RubyProperty("character_name")]
                public string CharacterName { get; set; }

                [RubyProperty("character_index")]
                public int CharacterIndex { get; set; }

                [RubyProperty("direction")]
                public int Direction { get; set; }

                [RubyProperty("pattern")]
                public int Pattern { get; set; }
            }
        }

        internal static IEnumerable<dynamic> Export(IObjectManager factory, IEnumerable list)
        {
            throw new NotImplementedException();
        }

    }
}
